package com.after.saas.file.handler;

import com.after.saas.file.constants.MedalTitleEnum;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @Description
 * @Classname Level
 * @Author hjchen
 * @Version V1.0.0
 * @Since 1.0
 * @Date 2023/4/7 15:38
 */

@Data
public abstract class MedalLevel {

    private MedalLevel next;

    /**
     * 勋章
     *
     * @return java.lang.String
     * @author hjchen
     * @date 2023/4/12 9:37
     **/
    public abstract MedalTitleEnum getMedalEnum();


    /**
     * 计算积分
     *
     * @param points
     * @return void
     * @author hjchen
     * @date 2023/4/7 15:39
     **/
    public abstract MedalRecord handleRequest(BigDecimal points);

    public boolean preRequest(BigDecimal points) {
        return points.compareTo(new BigDecimal(getMedalEnum().getPoint())) < 1;
    }
}
